package cn.tworice.client.web;

import cn.tworice.client.service.ResumeService;
import cn.tworice.common.entity.ResumeReceived;
import cn.tworice.common.entity.dto.ResumeReceivedDto;
import com.lmk.core.web.support.api.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 收到的简历控制层
 * @Author 二饭
 * @Email 1786705138@qq.com
 * @Date 2021/12/14 15:12
 */
@RestController
@RequestMapping("client/resumeReceived")
@CrossOrigin
public class ResumeReceivedClient {

    @Autowired
    private ResumeService resumeService;

    /**
     * @param companiesId 通过公司ID查询收到的简历
     * @Author 二饭
     * @Email 1786705138@qq.com
     * @Date 2021/12/14 15:15
     */
    @GetMapping("{id}")
    public RequestResult list(@PathVariable("id") String companiesId,Integer pageSize,Integer page){
        RequestResult result = new RequestResult();
        List<ResumeReceivedDto> list=resumeService.getResumeReceivedByCompaniesId(companiesId,page,pageSize);
        result.appendData("list", list);
        result.appendData("total", resumeService.getResumeReceivedCount(companiesId));
        return result;
    }





}
